﻿--入职设定
CREATE proc [dbo].[proc_Employee_EntrySet]
(
	@eid int,
	@departmentid nvarchar(4),
	@PCompanyId int,
	@postid int,
	@postcategory int,
	@gradeid int,
	@pluralist nvarchar(50),
	@rtx nvarchar(20),
	@wageCardNo nvarchar(50),
	@RuzhiDate nvarchar(50),
	@ProbationFrom datetime,
	@ProbationTo datetime,
	@Proposer nvarchar(50),
	@ZhiWu nvarchar(50),
	@kbn int,
	@id int,
	@XZJB NVARCHAR(50),
	@IsCore bit
)
as
	--设置
	if(@kbn = 1)
		update employee_Entry set TDepartmentId=@departmentid,TPCompanyId=@PCompanyId,TPostid=@postid,TGradeid=@gradeid,TPluralist=@pluralist,TRtx=@rtx,TWageCardNo=@wageCardNo,TRuzhiDate=@RuzhiDate,TPostcategory=@postcategory,TProbationFrom=@ProbationFrom,TProbationTo=@ProbationTo,Proposer=@Proposer,ApplionTime=getdate(),TZhiWu=@ZhiWu,TXZJB=@XZJB,IsCore=@IsCore where id=@id
	else
		begin
		insert into employee_Entry(Eid,TDepartmentId,TPostcategory,TPostid,TGradeid,TPluralist,TRtx,TWageCardNo,TRuzhiDate,TProbationFrom,TProbationTo,Proposer,ApplionTime,TPCompanyId,TZhiWu,TXZJB,IsCore)
		values(@Eid,@DepartmentId,@Postcategory,@Postid,@Gradeid,@Pluralist,@Rtx,@WageCardNo,@RuzhiDate,@ProbationFrom,@ProbationTo,@Proposer,getdate(),@PCompanyId,@ZhiWu,@XZJB,@IsCore)
		end